<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>作业9</title>
</head>
<body>
<script>
    // 4 的阶乘 4*3*2*1
  var randomNum = Math.floor(Math.random()*10+1);
  console.log(randomNum);
  var result=1;
  for (let i = 0; i < randomNum; i++) {
      result=result*(randomNum-i);
  }
  console.log(result);
</script>
</body>
</html>